﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SMA = System.Management.Automation;

namespace RSPowershell
{

    public enum PageOrientation
    {
        Landscape, Portrait
    }

    [System.Management.Automation.Cmdlet("New", "PrinterPreferences")]
    public class New_PrinterPreferences : SMA.Cmdlet
    {
        [SMA.Parameter(Mandatory = false)]
        public string Printer;

        [SMA.Parameter(Mandatory = false)]
        public string PrintFilename;

        [SMA.Parameter(Mandatory = false)]
        public string PaperName;
        
        [SMA.Parameter(Mandatory = false)]
        public float PaperWidth;

        [SMA.Parameter(Mandatory = false)]
        public float PaperHeight;

        [SMA.Parameter(Mandatory = false)]
        public string PaperSource;

        [SMA.Parameter(Mandatory = false)]
        public PageOrientation PageOrientation;

        protected override void ProcessRecord()
        {
            var pp = new PrinterPreferences();
            pp.PaperName = this.PaperName;
            pp.PaperHeight = this.PaperHeight;
            pp.PaperWidth= this.PaperWidth;
            pp.PaperSource = this.PaperSource;
            pp.PageOrientation = this.PageOrientation;
            pp.Printer = this.Printer;
            pp.PrintFilename= this.PrintFilename;

            this.WriteObject(pp);
        }
    }
}
